import { http } from '@/utils/http';

export type Dict = {
  id: number;
  name: string;
  code: string;
  description: string;
  createTime: string;
};

export type DictItem = {
  id: number;
  itemName: string;
  itemCode: string;
  itemAttribute: string;
  createTime: string;
};

type Result = {
  success: boolean;
  code: number;
  data: Array<Dict>;
};

type DictItemResult = {
  success: boolean;
  code: number;
  data: {
    rows: Array<DictItem>;
    total: number;
    page: number;
  };
};

export const getDictList = () => {
  return http.request<Result>('get', '/dict/getDictList');
};
export const getDictItemList = (params: any) => {
  return http.request<DictItemResult>('get', '/dict/getDictItemList', params);
};
